#使用ubuntu:24.04作为基础镜像
FROM ubuntu:24.04

#更新包列表和安装gcc g++环境
RUN apt-get update && apt-get install -y gcc g++ 

# 安装依赖库
RUN apt-get update && apt-get install -y \
    nlohmann-json3-dev \
    libmariadb-dev \
    libssl-dev \
    libcrypto++-dev \
    libjwt-dev \
    libhiredis-dev \
    && ldconfig # 更新动态库缓存

# 设置环境变量
ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/oj_server/lib/mariadb:/oj_server/lib/redis:/oj_server/lib/hiredis:$LD_LIBRARY_PATH

#设置工作目录
WORKDIR /oj_server

#复制文件
COPY ./oj_server.exe  /oj_server
COPY ./backup /oj_server/backup
COPY ./conf /oj_server/conf
COPY ./lib /oj_server/lib
COPY ./log /oj_server/log
COPY ./questions /oj_server/questions


